package com.game.view.component
{
	import com.dusk.util.ResUtil;
	
	import flash.display.Bitmap;
	
	public class ComboPanel extends ComponentBase
	{
		
		public function ComboPanel()
		{
			super();
		}
		
		private var numSprite:IndicateGadget;
		
		override protected function beforeAdded():void
		{
			if(getChildByName("PanelBg") == null)
			{
				var bg:Bitmap = ResUtil.getImageBitmap("ComboPanelBg");
				bg.name = "PanelBg";
				addChildAt(bg,0);
			}
		}
		
		public function addBatterNum(param1:uint):void
		{
			var posX:int;
			var posY:int;
			if (param1 < 10)
			{
				posX = 4;
				posY = 28.3;
			}
			else if (param1 < 100)
			{
				posX = -44.6;
				posY = 28.3;
			}
			else
			{
				posX = -95.6;
				posY = 28.3;
			}
			if (numSprite != null && contains(numSprite))
			{
				removeChild(numSprite);
				numSprite = null;
			}
			numSprite = new IndicateGadget();
			numSprite.value = param1;
			numSprite.setGadgetType(GameGadgetType.COMBO_NUM);
			numSprite.x = posX;
			numSprite.y = posY;
			addChild(numSprite);
		}
	}
}
